package org.gblog

class PostController {

    static scaffold = true

    def search() {
		//render Post.search(params.q, params)
		flash.message = "Search results for: ${params.q}" 
	    def resultsMap = Post.search(params.q, params) 
	    render(view:'search', 
	           model:[ 
	             postInstanceList:resultsMap.results,  
	             postInstanceTotal:Post.countHits(params.q) 
	           ] 
	    )
    }
}
